import request from '@/utils/request'



// 登录
export function login (username, password) {
  return request('api/user/info', {
    username,
    password,
  })
}



// 临时登录
export function tempLogin (username, password, tempToken = true) {
  return request('login', {
    username,
    password,
    system: 'SOM',
  }, tempToken)
}

// 获取用户信息
export function getUserInfo (token) {
  return request('getUserInfo', {
    token
  })
}

// 获取用户基础信息
export function customerInfo (token) {
  return request('customerInfo', {
    token
  })
}

// 登出
export function logout (token) {
  return request('logOut', {
    token
  })
}

// 修改密码
export function changePwd (args) {
  return request('changePwd', args)
}

// 修改用户信息
export function changeInfo (args) {
  return request('changeInfo', args)
}

// 用户注册
export function register (args, tempToken = true) {
  return request('register', args, tempToken)
}

// token 续期
export function renewal (args) {
  return request('pclogin/renewal', args)
}
// 获取验证码
export function verifyCode (args, tempToken = true) {
  return request('getCode', args, tempToken)
}

// 找回密码
export function findPass (args, tempToken = true) {
  return request('lostPwd', args, tempToken)
}

// 获取微信登陆sessionKey
export function sessionKey (args, tempToken = true) {
  return request('sessionKey', args, tempToken)
}

// 获取电话号码
export function getUserNumber (args, tempToken = true) {
  return request('getUserNumber', args, tempToken)
}
// 获取用户心跳
export function getHeartBeat (args, tempToken = true) {
  return request('heartbeat', args, tempToken)
}
